#region Usings

using System.ComponentModel;
using System.Drawing;
using GateShift.Common.Controls.Wizards.Design;

#endregion

namespace GateShift.Common.Controls.Wizards.Pages
{
    [ToolboxItem(false)]
    [Designer(typeof(WizardPageDesigner))]
    public partial class WizardFinalPage : WizardPageBase
    {

        #region Class Properties
        protected override System.Drawing.Size DefaultSize
        {
            get
            {
                return new Size(498, 328);
            }
        }
        [Browsable(true)]
        [Category("Wizard Page")]
        [Description("Gets or sets wizard page second description Text. This description used only by welocme and final pages")]
        public string Description2
        {
            get
            {
                return lblDescription2.Text;
            }
            set
            {
                if (value != lblDescription2.Text)
                {
                    lblDescription2.Text = value;
                    OnDescription2Changed();
                }
            }
        }
        #endregion

        #region Class Constructor/Finilize methods
        public WizardFinalPage()
        {
            InitializeComponent();

            this.Size = new Size(498, 328);
            this.Name = "wizFinalPage";
            base.WelcomePage = true;

            base.Title = lblWizardName.Text;
            base.Description = lblDescription.Text;
            base.HeaderImage = imgWelcome.Image;
            base.FinishPage = true;
        }

        #endregion

        #region Class overrides
        protected override void OnImageListChanged()
        {
            if (base.ImageList != null)
            {
                if (base.ImageIndex >= 0 && ImageIndex < base.ImageList.Images.Count)
                {
                    imgWatermark.Image = base.ImageList.Images[base.ImageIndex];
                }
            }
        }

        protected override void OnImageIndexChanged()
        {
            if (base.ImageList != null)
            {
                if (base.ImageIndex >= 0 && ImageIndex < base.ImageList.Images.Count)
                {
                    imgWatermark.Image = base.ImageList.Images[base.ImageIndex];
                }
            }
        }

        protected override void OnHeaderImageChanged()
        {
            imgWelcome.Image = base.HeaderImage;
        }

        protected override void OnTitleChanged()
        {
            lblWizardName.Text = base.Title;
        }

        protected override void OnDescriptionChanged()
        {
            lblDescription.Text = base.Description;
        }

        protected virtual void OnDescription2Changed()
        {
        }
        protected override void OnLoad(System.EventArgs e)
        {
            OnImageListChanged();
            OnHeaderImageChanged();
            base.OnLoad(e);
        }
        #endregion
    }
}